package com.infore.qualityControl.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.infore.qualityControl.bo.QualityParamSelectBo;
import com.infore.qualityControl.remoteService.IDataReceivingService;
import com.infore.qualityControl.select.util.PageObject;
import com.infore.qualityControl.service.ICQTestDataService;
import com.infore.qualityControl.util.ResultEntity;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

/**
 * 重庆比武质控数据测试控制层
 * @author Cold
 *
 */
@Api(value = "重庆比武测试数据管理接口", tags = {"重庆比武测试数据管理接口"})
@RestController
@RequestMapping("/CQtestData")
public class CQTestDataController {
	
	@Autowired
	ICQTestDataService ICQTestDataService;
	
	@Autowired
	IDataReceivingService IDataReceivingService;
	
	@ApiOperation(value = "获取24小时零点跨度核查表格数据")
	@ResponseBody
	@RequestMapping(value = "/zeroSpanCheckData", method = RequestMethod.GET)
	public ResultEntity zeroSpanCheckData(QualityParamSelectBo qualityParamSelectBo, PageObject pageObject) {
		return ICQTestDataService.zeroSpanCheckData(qualityParamSelectBo, pageObject);
	}
	
	@ApiOperation(value = "获取24小时零点跨度漂移表格数据")
	@ResponseBody
	@RequestMapping(value = "/zeroSpanDriftData", method = RequestMethod.GET)
	public ResultEntity zeroSpanDriftData(QualityParamSelectBo qualityParamSelectBo, PageObject pageObject) {
		return ICQTestDataService.zeroSpanDriftData(qualityParamSelectBo, pageObject);
	}
	
	@ApiOperation(value = "获取常规五参数核查表格数据")
	@ResponseBody
	@RequestMapping(value = "/fiveParameterData", method = RequestMethod.GET)
	public ResultEntity fiveParameterData(QualityParamSelectBo qualityParamSelectBo, PageObject pageObject) {
		return ICQTestDataService.fiveParameterData(qualityParamSelectBo, pageObject);
	}
	
	@ApiOperation(value = "获取实际水样对比表格数据")
	@ResponseBody
	@RequestMapping(value = "/realWaterSampleComparisonData", method = RequestMethod.GET)
	public ResultEntity realWaterSampleComparisonData(QualityParamSelectBo qualityParamSelectBo, PageObject pageObject) {
		return ICQTestDataService.realWaterSampleComparisonData(qualityParamSelectBo, pageObject);
	}
	
	@ApiOperation(value = "获取自动与手工比对测试数据")
	@ResponseBody
	@RequestMapping(value = "/automaticAndManualComparisonData", method = RequestMethod.GET)
	public ResultEntity automaticAndManualComparisonData(QualityParamSelectBo qualityParamSelectBo, PageObject pageObject) {
		return ICQTestDataService.automaticAndManualComparisonData(qualityParamSelectBo, pageObject);
	}
	
	@ApiOperation(value = "获取日志与状态量参数数据")
	@ResponseBody
	@RequestMapping(value = "/logStatusData", method = RequestMethod.GET)
	public ResultEntity logStatusData(String mn, String beginTime, String endTime, String logType, PageObject pageObject) {
		return IDataReceivingService.queryLogStatusData(mn, beginTime, endTime, logType, pageObject.getPageNumber(), pageObject.getPageSize());
	}
}
